package com.ghostbusters.fingertrack.calibration;

import java.io.Serializable;
import java.util.HashMap;

public class Calibration<E> implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = -1751397909334780971L;
	public static final int CALIBRATION_LENGTH = 100;
	public static final int CALIBRATION_SIZE = 100;
	public static final int BLUR = 2;
	private HashMap<E, Signature> map;

	public Calibration() {
		map = new HashMap<E, Signature>();
	}

	/**
	 * WARNING: This will normalize your list to CALIBRATION_LENGTH, so points
	 * will be lost, unless your list is of CALIBRATION_LENGTH
	 * 
	 * @param symbol
	 * @param signature
	 *            the signature you want to pass in (will be normalized)
	 */
	public void add(E symbol, Signature signature) {
		// normalizes calibration
//		signature.normalize(CALIBRATION_LENGTH, CALIBRATION_SIZE);
//		signature.generateBlurredMatrix(BLUR);
//		signature.generateRowspace();
		// signature.generateBlurredMatrix(1);
		// signature.generateRowspace();
		map.put(symbol, signature);
	}

	public HashMap<E, Signature> getMap() {
		return map;
	}

	// public HashMap<Symbol<E>, Signature> getMap(int level) {
	// for (Symbol<E> sym : map.keySet()) {
	//
	// }
	// }
	@Override
	public String toString() {
		return map.toString();
	}
}
